 package agency.web.app.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

import javax.persistence.Table;

@Entity
public class Agent extends AbstractUser {
	
	
	
	@ManyToMany(targetEntity = Client.class, fetch = FetchType.EAGER)
	@JoinTable(name = "agent_has_client", joinColumns = { @JoinColumn(name = "USER_ID") }, inverseJoinColumns = { @JoinColumn(name = "USER_ID") })
	private List <Client> clients;
	
	 
	public Agent(){
		
	}
	
	public Agent( String login, String password,
			String name, String phoneNumber, String email, Trip trip) {
		super(login, password, name, phoneNumber, email, trip);
		
	}

	public List<Client> getClients() {
		return clients;
	}

	public void setClients(List<Client> clients) {
		this.clients = clients;
	}


	
		
}
